<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>签到效果实现</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="../js/plugins/myDate/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="../js/plugins/dialog2/js/dialog.min.js"></script>
<link rel="stylesheet" type="text/css" href="../js/plugins/myDate/css/sign2.css"/>
<link rel="stylesheet" type="text/css" href="../js/plugins/dialog2/css/dialog.css"/>
<script type="text/javascript" src="../js/plugins/myDate/js/calendar2.js"></script>
<script type="text/javascript">
$(function(){
    var user = JSON.parse(sessionStorage.getItem("user"));
  //ajax获取日历json数据
  var signList=[];
  $.get("/signs/"+user.id,function (data) {
      if (data.result!=null) {
          $.each(data.result,function (index,ele) {
              signList.push({"signDay":new Date(ele.signTime).getDate()});
          });
          var tmp=[];
          calUtil.init(signList,tmp);
      } else {
          signList=[];
      }
  })
   //刷新页面获取

    calUtil.init(signList);
    $("#sign_note").click(function () {
        $.get('/signs/selectStates',function (data) {
            if(data.result==1){
                $(document).dialog({
                    titleShow: '温馨提示',
                    content: '今天已经领取过了',
                    autoClose: 1500
                });
                return;
			}else{
                $.post('/wallets/updateBalances',{userId:user.id,integral:200},function (data) {

                });

                $(document).dialog({
                    titleShow: '温馨提示',
                    content: '累计签到3天,增加积分200',
                    autoClose: 1500
                });
			}
        })

    })
});
</script>

</head>
<body>
	
<div style="" id="calendar"></div>

<div id="sign_note" style="text-align:center;position: relative;padding: 15px;    font-size: 14px;">
	<span style="color:red;">*规则：本月签到3天有特殊的奖励</span>
</div>
</body>
</html>